package cs422.project2;

import java.util.ArrayList;

import processing.core.PApplet;
import cs422.project2.sketch.ExampleSketch;
import cs422.project2.sketch.Sketch;
import cs422.project2.sketch.data.Variable;

public class Main extends PApplet{

	// leave this alone
	private static final long serialVersionUID = 1L;
	
	// 
	protected ArrayList<Sketch> sketches = new ArrayList<Sketch>();
	
	@Override
	public void setup() {
		size(1000, 500);
		initSketches();
	
	}
	
	/**
	 * Used to initialise all the sketches, each sketch is added to the arraylist
	 */
	public void initSketches(){
		Variable dat = new  Variable();
		dat.setParent(this);
		dat.setPlot(10, 10, 500, 200);
		
		sketches.add(new ExampleSketch(dat));
		
		dat.setPlot(10, 210, 500, 200);
		sketches.add(new ExampleSketch(dat));
	}
	
	@Override
	public void draw() {
		for(int i = 0; i < sketches.size(); i++){
			sketches.get(i).display();
		}
	}
	
	/**
	 * I am going to add methods for event processing here.
	 * They would work the same way as display()
	 * I am not sure which ones to put, mouse and key are obvious but we'll add as we go along
	 */
	
	
	
}
